package com.ruoyi.wisdom.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wisdom.domain.FzServiceAdvertisement;
import com.ruoyi.wisdom.mapper.FzServiceAdvertisementMapper;
import com.ruoyi.wisdom.service.IFzServiceAdvertisementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 发布广告Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-05
 */
@Service
public class FzServiceAdvertisementServiceImpl implements IFzServiceAdvertisementService
{
    @Autowired
    private FzServiceAdvertisementMapper fzServiceAdvertisementMapper;

    /**
     * 查询发布广告
     * 
     * @param adId 发布广告ID
     * @return 发布广告
     */
    @Override
    public FzServiceAdvertisement selectFzServiceAdvertisementById(String adId)
    {
        return fzServiceAdvertisementMapper.selectFzServiceAdvertisementById(adId);
    }

    /**
     * 查询发布广告列表
     * 
     * @param fzServiceAdvertisement 发布广告
     * @return 发布广告
     */
    @Override
    public List<FzServiceAdvertisement> selectFzServiceAdvertisementList(FzServiceAdvertisement fzServiceAdvertisement)
    {
        return fzServiceAdvertisementMapper.selectFzServiceAdvertisementList(fzServiceAdvertisement);
    }

    /**
     * 新增发布广告
     * 
     * @param fzServiceAdvertisement 发布广告
     * @return 结果
     */
    @Override
    public int insertFzServiceAdvertisement(FzServiceAdvertisement fzServiceAdvertisement)
    {
        fzServiceAdvertisement.setCreateTime(DateUtils.getNowDate());
        return fzServiceAdvertisementMapper.insertFzServiceAdvertisement(fzServiceAdvertisement);
    }

    /**
     * 修改发布广告
     * 
     * @param fzServiceAdvertisement 发布广告
     * @return 结果
     */
    @Override
    public int updateFzServiceAdvertisement(FzServiceAdvertisement fzServiceAdvertisement)
    {
        fzServiceAdvertisement.setUpdateTime(DateUtils.getNowDate());
        return fzServiceAdvertisementMapper.updateFzServiceAdvertisement(fzServiceAdvertisement);
    }

    /**
     * 删除发布广告对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzServiceAdvertisementByIds(String ids)
    {
        return fzServiceAdvertisementMapper.deleteFzServiceAdvertisementByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除发布广告信息
     * 
     * @param adId 发布广告ID
     * @return 结果
     */
    @Override
    public int deleteFzServiceAdvertisementById(String adId)
    {
        return fzServiceAdvertisementMapper.deleteFzServiceAdvertisementById(adId);
    }
}
